<template>
  <div>
    <h2>搜索结果:</h2>
    <van-card
  v-for="(item,index) in list"
  :key="index"
  :title="item.title"
  thumb="https://img01.yzcdn.cn/vant/ipad.jpeg"
/>
  </div>
</template>

<script>
export default {
  data(){
    return{
      list:[],
      lists:[],
    }
  },
  mounted(){
    this.$axios.get("datas.json").then((res)=>{
      this.lists = res.data.res
      // console.log(res);
      this.getlist();
    });
  },
  methods:{
    getlist(){
      let res = this.lists.filter((item)=>{
       return item.title.includes(this.$route.query.value)
      })
      this.list = res
    }
  }
}
</script>

<style>

</style>